<?php 
	
	// ** Admin Settings ** //
     $settings = AdminSettings::first();
	 
	$trueProfile    = true; 
	$projects_users = true;

?>

<?php $__env->startSection('title'); ?><?php echo Lang::get('users.projects'); ?> - <?php echo e( $user->name ); ?> - <?php $__env->stopSection(); ?>

 <?php echo $__env->make('includes.cover-static', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->startSection('content'); ?> 

<!-- Col MD -->
<div class="col-md-12">	

<?php if( Auth::check() && Auth::user()->id == $user->id && Auth::user()->type_account != 1 ): ?>
<!-- ***** Modal ****** -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title text-left" id="myModalLabel"><strong><?php echo Lang::get('misc.new_project'); ?></strong></h4>
	      </div>
	      
	      <div class="modal-body">
	      	
	     <form class="form-horizontal" id="form-edit-shot" method="post" role="form" action="<?php echo URL::to('/'); ?>/add/project">
			 
			 <div class="form-group <?php if( $errors->first('title') ): ?> has-error <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.title'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="" name="title" class="form-control input-sm" id="title" placeholder="<?php echo Lang::get('misc.title'); ?>">
	     			
	     		<?php if( $errors->first("title") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("title"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->
			  
			  <div class="form-group <?php if( $errors->first('description') ): ?> has-error <?php endif; ?>">
			    <label class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.description'); ?> (<?php echo Lang::get('misc.optional'); ?>)</label>
			    <div class="col-sm-10">
			      <textarea name="description" rows="4" id="description" class="form-control input-sm textarea-textx"></textarea>
	             
	             <?php if( $errors->first("description") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("description"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->
			  			  
			  <div class="form-group">
			    <div class="col-sm-offset-2 col-sm-10">
			      <button style="padding: 9px 30px;" type="submit" class="btn btn-info btn-sm btn-sort" id="addProject">
			      	<?php echo Lang::get('users.create'); ?>

			      	</button>
			    </div>
			  </div><!-- **** form-group **** -->
			  
			</form><!-- **** form **** -->
			    
	      </div><!-- modal-body -->
	    </div>
	  </div>
	</div> <!-- ***** Modal ****** -->
	<?php endif; ?>
			
<?php if( $totalGlobal != 0 ): ?>
	
	<h1 class="title-item none-overflow">
	<?php echo Lang::get('users.projects'); ?> <small>(<?php echo Helper::formatNumber( $totalGlobal ); ?>)</small>

	<?php if( Auth::check() && Auth::user()->id == $user->id && Auth::user()->type_account != 1 ): ?>
		<button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-sm btn-success pull-right">
			<i class="glyphicon glyphicon-plus myicon-right"></i> <?php echo Lang::get('misc.new_project'); ?>

			</button>
	<?php endif; ?>
	</h1> 
<hr />


	<?php echo $__env->make('includes.projects-view', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>


<?php if( $data->getTotal() != $data->count() ): ?>
     
    	   <hr />
    	   
  <div class="btn-group paginator-style">
		   <?php echo $data->links(); ?> 
		</div>
		
<?php endif; ?>

				  	
	<?php else: ?>
	
	<?php if( Auth::check() && $user->id != Auth::user()->id || !Auth::check() ): ?>
	
	<div class="btn-block text-center">
	    	<i class="icon-briefcase ico-no-result"></i>
	    </div>
	    
	<h3 class="margin-top-none text-center no-result user-no-result">
	    	- <strong><?php echo $user->name; ?></strong> <?php echo Lang::get('users.no_project'); ?> -
	    	</h3>
	    	
	    <?php elseif(Auth::check() && $user->id == Auth::user()->id): ?>	
	 
		<div class="btn-block text-center">
	    	<i class="icon-briefcase ico-no-result"></i>
	    </div>
	    
	    <h3 class="margin-top-none text-center no-result user-no-result">
	    	- <?php echo Lang::get('users.session_no_project'); ?> -
	    	</h3>	
	    	
	    	<?php endif; ?>
	    	
	    	<?php if( Auth::check() && Auth::user()->type_account != 1 && Auth::user()->id == $user->id ): ?>  
	   <div class="btn-block text-center" style="margin-bottom: 20px;">
	   	<button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-sm btn-success">
			<i class="glyphicon glyphicon-plus myicon-right"></i> <?php echo Lang::get('misc.new_project'); ?>

			</button>
	   </div> 
		<?php endif; ?>
	
	
	<?php endif; ?>
	
</div><!-- /COL MD -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
<?php echo HTML::script('public/js/count.js'); ?>

<script type="text/javascript">

<?php if(Session::has('success_add')): ?>
	 $('.popout').html("<?php echo Session::get('success_add'); ?>").fadeIn(500).delay(5000).fadeOut();
   <?php endif; ?>
   
   <?php if( Session::has('error_add') ): ?>
   	$('#myModal').modal('show');
   <?php endif; ?>

$("#addProject").on('click',function(){
    	$(this).css({'display': 'none'})
    });
    
	$("#description").charCount({ allowed: <?php echo $settings->message_length; ?>, warning: 10, css: 'counterBio' });

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>